1. Field of the Invention
This invention relates to the field of computer systems, and in particular to a method and apparatus for identifying wait states and providing a wait cursor during computer system operation.
2. Background Art
In a multi-tasking environment, a plurality of computer programs, such as application programs (hereinafter referred to as "programs"), can be used simultaneously by a computer user. Each program may have one or more associated windows into which its display data will be displayed on a display device, such as a video or liquid crystal display. A user may enter commands and interact with a program by manipulating data or images in a window, or by selecting operations from a menu associated with the window or associated program, using input devices such as a mouse, keyboard, joystick, cross-key, or the like. Such input devices may also operate as position translating devices, which can be used to position a graphical, on-screen pointer, such as a cursor. A cursor functions, for example, to indicate a character to be revised or to indicate a position where data is to be entered or an operation is to be performed. A cursor, in some form or appearance, is typically present on the computer display. Manipulation of an input device by a user will result in a corresponding movement of the cursor. Thus, for example, movement of a mouse results in movement of the cursor in the same direction.
A cursor may have different appearances depending on its function and the state of the computer system. For example, when positioned in a text field on a computer display, the cursor may have the appearance of an "I-beam", or a blinking vertical line. The position of the cursor in a text field indicates the location of the next character that will be entered by the user, typically via a keyboard. The cursor may have other appearances depending on its function. In a drawing or painting program, the cursor may be represented as a paint brush, pencil, eraser, bucket, or other graphic form.
The cursor may also take the shape of an arrow or pointer when positioned over user-selectable operations or when it is used to select graphical elements, such as windows. To select and activate a desired operation with the cursor, it may be positioned over a graphical or text representation of the operation. A button located on a mouse input device may be depressed and/or released to effectuate the operation. The user is notified of the acceptance of the operation for execution by visual feedback, usually in the form of some change in an image on the computer's display. This visual response is typically generated by one or more programs presently in use. These programs generate drawing commands to update the display images in response to the selected operations.
In certain circumstances, the provision of the visual response that indicates acceptance of a user command is delayed or prevented. For example, a user typically chooses one operation for execution by the computer, and then selects another operation. The first selected operation is often being executed when a user selects the subsequent operation. This creates a "wait state" during which the program, (and, thus, the display), does not provide any visual response to indicate acceptance of a command made during the execution of the "active" operation.
To inform the user that the computer is in a wait state, prior art programs often provide a mechanism to change the function and appearance of the cursor to a so-called "wait cursor". The wait cursor provides a visual cue to the user to indicate that the user cannot select or perform operations during the program wait state. When the wait state ends, the program converts the wait cursor to its non-wait state cursor appearance.
Prior art methods of providing a wait cursor are implemented at the program level. That is, each program includes instructions to determine when to provide and to generate a wait cursor. A program level wait cursor is not of suitable reliability in a multi-tasking environment, particularly in a system that uses virtual memory.
When a program is accessed, the code or instructions of that program must be resident in main memory. This main memory is typically random access memory (RAM) that stores the instructions to be executed by the processor of the computer system. In a virtual memory system, main memory is divided into "physical" and "secondary" memories. The physical memory is generally a dynamic random access memory (DRAM) and the secondary memory is generally a mass storage device, such as a hard disk. The combination of physical and secondary memory results in the availability of more main memory than can be provided with RAM alone.
In a virtual memory system, the program to be executed must be resident in physical memory before it can be executed. The program code associated with current program operations is likewise stored in physical memory. The code of other programs not presently running or being executed may be stored in secondary memory. During "application switching", that is, when the user switches from one program to another, if the code associated with the newly selected program is not resident in physical memory, it must be "paged in" from secondary memory and stored in physical memory.
Paging is a computer operation during which the user must be advised that a wait state exits, and that no further operations can be acknowledged or performed. Unfortunately, the program code that determines whether a wait cursor should be displayed, and which generates the wait cursor, is not resident in physical memory until the paging operation is concluded. As a result, a wait cursor cannot be provided until the paging operation is completed. The user will, therefore, not be informed that a wait state exists. In other words, the loading of a program results in a wait state and requires the display of a wait cursor, but the wait cursor cannot be displayed until the program responsible for generating the wait cursor is already loaded and executing.
There are other situations, in addition to program switching, during which the prior art fails to provide a suitable wait cursor. For example, the size of a program may be greater than can be stored in physical memory. Portions of the program code therefore must be stored in physical memory and the remainder in secondary memory. As program operations are performed, required code for these operations is paged in from secondary memory to physical memory. If the program code that implements the wait cursor is not resident in physical memory when a wait state exists, no wait cursor is provided and the user is not informed of the wait state.
Therefore, it is an object of the present invention to provide a method and apparatus for identifying wait states and providing a wait cursor that is independent of programs executing on a computer system.
It is another object of the present invention to provide a method and apparatus for identifying wait states and providing a wait cursor that can operate during paging operations.